package cn.kgc.rediscache.pojo;


import java.io.Serializable;

public class Employee implements Serializable,Cloneable{

  private long id;
  private String lastName;
  private String email;
  private long gender;
  private long dId;
  private Department department;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public long getGender() {
    return gender;
  }

  public void setGender(long gender) {
    this.gender = gender;
  }

  public long getdId() {
    return dId;
  }

  public void setdId(long dId) {
    this.dId = dId;
  }

  public Department getDepartment() {
    return department;
  }

  public void setDepartment(Department department) {
    this.department = department;
  }

  @Override
  public String toString() {
    return "Employee{" +
            "id=" + id +
            ", lastName='" + lastName + '\'' +
            ", email='" + email + '\'' +
            ", gender=" + gender +
            ", dId=" + dId +
            '}';
  }

  @Override
  public Object clone() throws CloneNotSupportedException {
    try {
      Employee employee = (Employee) super.clone();
      employee.setDepartment(employee.getDepartment().clone());
      return employee;

    } catch (CloneNotSupportedException e) {
      throw new CloneNotSupportedException();
    }
  }
}
